﻿using ComplexNumbers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace ComplexTest
{
    
    
    /// <summary>
    ///This is a test class for DescardTest and is intended
    ///to contain all DescardTest Unit Tests
    ///</summary>
    [TestClass()]
    public class DescardTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for op_Addition
        ///</summary>
        [TestMethod()]
        public void op_AdditionTest()
        {
            Descard first = new Descard(1,1); // TODO: Initialize to an appropriate value
            Descard second = new Descard(2,2); // TODO: Initialize to an appropriate value
            Descard expected = new Descard(3,3); // TODO: Initialize to an appropriate value
            Descard actual;
            actual = (first + second);
            Assert.AreEqual(expected.Real, actual.Real);
            Assert.AreEqual(expected.Imaginary, actual.Imaginary);
        }

        /// <summary>
        ///A test for op_Addition
        ///</summary>
        [TestMethod()]
        public void op_AdditionTest1()
        {
            Descard first = new Descard(0, 0); // TODO: Initialize to an appropriate value
            Descard second = new Descard(2, 2); // TODO: Initialize to an appropriate value
            Descard expected = new Descard(2, 2); // TODO: Initialize to an appropriate value
            Descard actual;
            actual = (first + second);
            Assert.AreEqual(expected.Real, actual.Real);
            Assert.AreEqual(expected.Imaginary, actual.Imaginary);
        }

        /// <summary>
        ///A test for op_Division
        ///</summary>
        [TestMethod()]
        public void op_DivisionTest()
        {
            Descard first = new Descard(15,0);
            Descard second = new Descard(3, 0);
            Descard expected = new Descard(5,0);
            Descard actual;
            actual = (first / second);
            Assert.AreEqual(expected.Real, actual.Real);
            Assert.AreEqual(expected.Imaginary, actual.Imaginary);
        }

        /// <summary>
        ///A test for op_Multiply
        ///</summary>
        [TestMethod()]
        public void op_MultiplyTest()
        {
            Descard first = new Descard(0,1);
            Descard second = new Descard(0,0);
            Descard expected = new Descard(0,0);
            Descard actual;
            actual = (first * second);
            Assert.AreEqual(expected.Real, actual.Real);
            Assert.AreEqual(expected.Imaginary, actual.Imaginary);
        }
    }
}
